<?php
/**
* @version $Id: login.html.php 10002 2008-02-08 10:56:57Z willebil $
* @package Joomla
* @subpackage Users
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

/**
* @package Joomla
* @subpackage Users
*/
class loginHTML {

	function loginpage ( &$params, $image ) {
		global $mosConfig_lang;
		
		// used for spoof hardening
		$validate = josSpoofValue(1);

		$return = $params->get('login');
		?>
		<div class="center_item" style="margin:0;">
			<h3 class="center_title">Đăng nhập hệ thống</h3>
			<form action="<?php echo sefRelToAbs( 'index.php?option=login' ); ?>" method="post" name="login" id="login">
			<table width="575" border="0" align="center" cellpadding="0" cellspacing="0" class="contentpane<?php echo $params->get( 'pageclass_sfx' ); ?>">
			<tr>
				<td>
				<?php
				if ( $params->get( 'page_title' ) ) {
					?>
					<div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
					<?php echo $params->get( 'header_login' ); ?>
					</div>
					<?php
				}
				?>
				<div style="line-height:22px; padding-top:10px; color:red;">
				<?php echo $image; ?>
				<?php
				if ( $params->get( 'description_login' ) ) {
					 ?>
					<?php echo $params->get( 'description_login_text' ); ?>
					<?php
				}
				?>
				</div>
				</td>
			</tr>
			<tr>
				<td align="center" width="100%">
					<br />
					<table width="98%" cellpadding="5" cellspacing="5">
					<tr>
						<td align="left" width="30%">
						<?php echo _USERNAME; ?>
						</td>
						<td align="left" width="70%">
						<input name="username" type="text" class="inputbox" size="30" />
						</td>
					</tr>
					<tr>
						<td align="left">
						<?php echo _PASSWORD; ?>
						</td>
						<td align="left">
						<input name="passwd" type="password" class="inputbox" size="30" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td align="left">
						<input type="checkbox" name="remember" class="inputbox" value="yes" />&nbsp;<?php echo _REMEMBER_ME; ?>
						<br/>
						<a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&amp;task=lostPassword' ); ?>" style="color:#000; font-weight:bold;">
						<?php echo _LOST_PASSWORD; ?>
						</a>
						<?php
						if ( $params->get( 'registration' ) ) {
							?>
							<br/>
							<?php echo _NO_ACCOUNT; ?>
							<a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&amp;task=register' ); ?>" style="color:#000; font-weight:bold;">
							<?php echo _CREATE_ACCOUNT;?>
							</a>
							<?php
						}
						?>
						</td>
					</tr>
					<tr>
						<td></td>
						<td align="left">
						<div align="left">
						<input type="submit" name="submit" class="button" value="<?php echo _BUTTON_LOGIN; ?>" />
						</div>
						</td>
					</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
				<noscript>
				<?php echo _CMN_JAVASCRIPT; ?>
				</noscript>
				</td>
			</tr>
			</table>
			<?php
			// displays back button
			mosHTML::BackButton ( $params );
			?>
	
			<input type="hidden" name="op2" value="login" />
			<input type="hidden" name="return" value="<?php echo sefRelToAbs( $return ); ?>" />
			<input type="hidden" name="lang" value="<?php echo $mosConfig_lang; ?>" />
			<input type="hidden" name="message" value="<?php echo $params->get( 'login_message' ); ?>" />
			<input type="hidden" name="<?php echo $validate; ?>" value="1" />
			</form>
		</div>	
		<?php
  	}

	function logoutpage( &$params, $image ) {
		global $mosConfig_lang;

		$return = $params->get('logout');
		?>
		<form action="<?php echo sefRelToAbs( 'index.php?option=logout' ); ?>" method="post" name="login" id="login">
			<table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="contentpane<?php echo $params->get( 'pageclass_sfx' ); ?>">
		<tr>
			<td valign="top">
			<?php
			if ( $params->get( 'page_title' ) ) {
				?>
				<div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
				<?php echo $params->get( 'header_logout' ); ?>
				</div>
				<?php
			}
			?>
			<div>
			<?php
			echo $image;

			if ( $params->get( 'description_logout' ) ) {
				echo $params->get( 'description_logout_text' );
				?>
				<br/><br/>
				<?php
			}
			?>
			</div>
			</td>
		</tr>
		<tr>
			<td align="center">
			<div align="center">
			<input type="submit" name="Submit" class="button" value="<?php echo _BUTTON_LOGOUT; ?>" />
			</div>
			</td>
		</tr>
		</table>
		<?php
		// displays back button
		mosHTML::BackButton ( $params );
		?>

		<input type="hidden" name="op2" value="logout" />
		<input type="hidden" name="return" value="<?php echo sefRelToAbs( $return ); ?>" />
		<input type="hidden" name="lang" value="<?php echo $mosConfig_lang; ?>" />
		<input type="hidden" name="message" value="<?php echo $params->get( 'logout_message' ); ?>" />
		</form>
		<?php
	}
}
?>